package com.cxh.filter;

import java.io.IOException;
import java.net.URLEncoder;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.filter.OncePerRequestFilter;

import com.alibaba.fastjson.JSON;
import com.google.gson.GsonBuilder;
import com.cxh.util.AiuiUnit;
import com.cxh.util.CommonUtility;
import com.cxh.util.HttpUtil;
import com.cxh.util.LogUtil;

public class TestFilter extends OncePerRequestFilter{
	@Override
	protected void doFilterInternal(HttpServletRequest request,
			HttpServletResponse response, FilterChain filterChain)
			throws ServletException, IOException {
		request.setCharacterEncoding("utf-8");
		final String question = request.getParameter("answer");
		// 第一步先判断机器人Id是否被注册以及问题是否为空
		String code=request.getParameter("code");
		StringBuffer requestURL = request.getRequestURL();
		String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
		LogUtil.info("请求时间"+format+"========请求地址"+requestURL.toString());
	}
	
}
